﻿using System.Collections;
using System.Collections.Generic;
using com.yd.sdk.api;
using UnityEngine;

public class RemoteConfigManager : MonoBehaviour
{
    private AndroidJavaClass _javaClass;
    private AndroidJavaClass JavaClass
    {
        get
        {
            _javaClass = _javaClass ?? new AndroidJavaClass(Const.RemoteConfigImp);
            return _javaClass;
        }
    }

    void Start()
    {
        DontDestroyOnLoad(gameObject);
    }

    /// <summary>
    /// 获取远程的值
    /// </summary>
    /// <param name="key"></param>
    /// <returns></returns>
    public string GetString(string key)
    {
        //基本没有做保护..该报错尽量报
        return JavaClass.CallStatic<string>("GetString", key);
    }


    public void TestRemoteConfig()
    {
        Debug.Log("TestRemoteConfig:"+GetString("RemoteGM"));
    }

}
